package com.itheima.day03.ZuoYe.ZuoYe2;

public class Factory {
    public static Payment pay(String type) {
        switch (type) {
            case  "WeChat":
                    Payment W = new WeChatpay();
                    return W;
            case  "Ali":
                Payment A = new Alipay();
                return A;
            case  "Bank":
                Payment B = new Bankpay();
                return B;
        }
        return null;
        }
    }
